package com.itheima.controller;


import com.itheima.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/search")
public class ElasticController {
    @Autowired
    private SearchService searchService;
    @PostMapping
    public Map search(@RequestBody Map searchMap) throws Exception {
        Map resultMap = searchService.search(searchMap);
        return resultMap;
    }
}
